package com.z.blog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.z.base.vo.PageVo;
import com.z.blog.entity.Comment;
import com.z.blog.mapper.CommentMapper;
import com.z.blog.service.ICommentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评论实体Service业务层处理
 *
 * @author jmys
 * @date 2022-09-01
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper,Comment> implements ICommentService {


    /**
     * 查询评论实体
     * @param comment 评论实体
     * @param pageInfo
     * @return 评论实体 分页集合
     * */
    @Override
    public PageInfo<Comment> selectCommentPage(Comment comment, PageVo pageInfo) {
        PageHelper.startPage(pageInfo.getPage(), pageInfo.getLimit());
        List<Comment> data = baseMapper.selectCommentList(comment);
        return new PageInfo<>(data);
    }

}
